<template>
  <el-container>
    <el-header style="background-color: #409EFF">
      <el-row :gutter="20">
        <el-col :span="1.5"><div class="grid-content bg-purple">
          <el-image style="width: 50px; height: 50px; padding-top: 5px" :src="iconUrl" :fit="fill"></el-image>
        </div></el-col>
        <el-col :span="6"><div class="grid-content bg-purple">
          <h3>SmartFarm</h3>
        </div></el-col>
        <el-col :span="12"><div class="grid-content bg-purple">
          <div style="margin-top: 15px;">
            <el-input placeholder="请输入内容" v-model="input3" class="input-with-select">
              <el-button slot="append" icon="el-icon-search"></el-button>
            </el-input>
          </div>
        </div></el-col>
        <el-col offset="2" :span="2"><div class="grid-content bg-purple" style="padding-top: 20px">
          <el-dropdown trigger="click">
          <span class="el-dropdown-link">
            XX用户
            <i class="el-icon-caret-bottom el-icon--right"></i>
          </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item class="clearfix">
                评论
                <el-badge class="mark" :value="12" />
              </el-dropdown-item>
              <el-dropdown-item class="clearfix">
                回复
                <el-badge class="mark" :value="3" />
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div></el-col>
      </el-row>
    </el-header>
    <el-container>
      <el-aside width="165px" style="">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
            router>
            <el-submenu v-for="item in menu" :index="item.id" :key="item.id">
              <template slot="title">
                <i :class="item.icon"></i>
                <span v-text="item.name"></span>
              </template>
              <el-menu-item-group class="over-hide" v-for="sub in item.sub" :key="sub.componentName">
                <el-menu-item :index="/smartFarmMain/ + sub.componentName" v-text="sub.name">
                </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
      </el-aside>
      <el-container>
        <el-main><router-view/></el-main>
      </el-container>
    </el-container>
  </el-container>
</template>
<script>
  import menu from '@/config/userMenu-config'
  export default {
    data () {
      return {
        iconUrl: require('@/assets/Farm.png'),
        menu: menu
      }
    },
    methods: {

    }
  }
</script>
<style>
.el-menu {
  border-right: none;
  overflow:hidden;
  resize:none;
}
.el-footer{
  background-color: #DCDFE6;
}
.el-aside {
  background-color: #545c64;
  color: #333;
  line-height: 200px;
}

</style>
